package com.starry.core.utils

import android.app.Activity

object ActivityController {
    private val activities= mutableListOf<Activity>()

    fun  addActivity(activity: Activity){
        activities.add(activity)
    }
    fun removeActivity(activity: Activity){
        activities.remove(activity)
    }

    fun finishAll(){
        for (ac:Activity in activities){
            if(!ac.isFinishing){
                ac.finish()
            }
        }
        activities.clear();
    }
}